-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documents to the function (irishandler) #3
base: main
Are you sure you want to change the base?
Conversation
@@ -256,6 +256,7 @@ func (sc *SecretConnection) SetWriteDeadline(t time.Time) error { | |||
return sc.conn.(net.Conn).SetWriteDeadline(t) | |||
} | |||
|
|||
// genEphKeys generates Ephemeral key-pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a library imported from tendermint itself. No need to put commnts support here.
chains/irisnet/handlerIrisnet.go
Outdated
@@ -93,6 +98,10 @@ func RunDataConnect(peerAddr string, | |||
} | |||
} | |||
|
|||
// dialPeer will check if the Peer has dialed succesfully or not, | |||
// This function is used RunDataConnect, if there are errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't mention caller
chains/irisnet/handlerIrisnet.go
Outdated
@@ -103,6 +112,10 @@ func (h *TendermintHandler) dialPeer() error { | |||
return nil | |||
} | |||
|
|||
// acceptPeer will check the if the Peer has connected succesfully | |||
// or not, this function is used in RunDataConnect, if there are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont mention caller
chains/irisnet/handlerIrisnet.go
Outdated
@@ -120,6 +133,10 @@ func (h *TendermintHandler) acceptPeer() error { | |||
return nil | |||
} | |||
|
|||
// upgradeConnectionAndHandshake checks if there has been a secret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rephrase. It ESTABLISHES, not CHECKS
chains/irisnet/handlerIrisnet.go
Outdated
@@ -138,6 +155,12 @@ func (h *TendermintHandler) upgradeConnectionAndHandshake() error { | |||
return nil | |||
} | |||
|
|||
// handshake function follows the protocol set on amino spec, | |||
// MarshalBinaryLengthPrefixed encodes the object according to the Amino spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't mention exact amino codec setup. We just need to know that how handshake happens
chains/irisnet/handlerIrisnet.go
Outdated
@@ -215,6 +240,13 @@ func (h *TendermintHandler) beginServicing() error { | |||
return nil | |||
} | |||
|
|||
// Datas are recived by TM Core | |||
// sendRoutine sends PING and PONG message to TM Core | |||
// case h.p2pConnection.pingTimer.C: Sends PING messages to TM Core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cases are bad in comments, not needed. Mention agenda, not code.
@@ -183,6 +206,8 @@ func (h *TendermintHandler) handshake() error { | |||
return nil | |||
} | |||
|
|||
// forms a P2P connection with the registered node | |||
// sends and recives routines accordingly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong... it "services" the TM core and not forms the connection...
chains/irisnet/handlerIrisnet.go
Outdated
@@ -643,6 +682,8 @@ func (c *P2PConnection) stopPongTimer() { | |||
// ---------------------- SPAM FILTER INTERFACE -------------------------------- | |||
|
|||
// RunSpamFilter serves as the entry point for a TM Core handler when serving as a spamfilter | |||
// This function also acts as filter at the very begining of the TM Core, spam filter depends |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong!. spamfilter is completely different mode. Number of spam filter is wrong. it is number of worker goroutines spawned
chains/irisnet/handlerIrisnet.go
Outdated
@@ -764,6 +809,8 @@ func (h *TendermintHandler) beginServicingSpamFilter(id int) { | |||
} | |||
} | |||
|
|||
// thoroughMessageCheck is used in beginServicingSpamFilter. | |||
// thoroughMessageCheck verify the Messages from the Marlin Relay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell, What would be the correct Statement here!
chains/irisnet/handlerIrisnet.go
Outdated
@@ -670,6 +711,10 @@ func RunSpamFilter(rpcAddr string, | |||
handler.throughput.presentThroughput(5, handler.signalShutThroughput) | |||
} | |||
|
|||
// Spam Filter executions begins from beginServicingSpamFilter | |||
// this function will check for all possible spam from TM Core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not from TMCore. Spam is always checked at ingress point of marlin relay
chains/irisnet/handlerIrisnet.go
Outdated
@@ -853,6 +903,12 @@ func (h *TendermintHandler) getValidators(height int64) ([]Validator, bool) { | |||
} | |||
} | |||
|
|||
// spamVerdictMessage used in beginServicingSpamFilter. This function | |||
// is used to store Messages of Marlin and even return the Boolean value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store messages? it just gives out signal to either allow or deny messages
chains/irisnet/handlerIrisnet.go
Outdated
@@ -876,6 +932,7 @@ var isKeyFileUsed, memoized bool | |||
var keyFileLocation string | |||
var privateKey ed25519.PrivKeyEd25519 | |||
|
|||
//Generates privatekey and publickey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ED25519 Keypair
chains/irisnet/handlerIrisnet.go
Outdated
@@ -971,7 +1031,7 @@ func getPrivateKey() ed25519.PrivKeyEd25519 { | |||
|
|||
// ---------------------- COMMON UTILITIES --------------------------------- | |||
|
|||
|
|||
//Creates Tendermint Handler between Marlin Relay and TM Core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creates between relay and TM core? no really... it just creates a handler object
chains/irisnet/handlerIrisnet.go
Outdated
@@ -1028,7 +1089,8 @@ func (t *throughPutData) putInfo(direction string, key string, count uint32) { | |||
} | |||
t.mu.Unlock() | |||
} | |||
|
|||
// This function display the logs/stats of marlin to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to marlinTo and marlinFrom actually
@@ -120,6 +129,8 @@ type ConsensusMessage interface { | |||
ValidateBasic() error | |||
} | |||
|
|||
// RegisterConsensusMessages registers the Consensus Messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
between tendermint and consensus layer? consensus layer is in tendermint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly resolve issues, comments are mostly not correct, with incorrect descriptions and consistency.
Still working on it, will commit as soon as wrote more about those.